From: Stefan Monnier Date: Mon, 24 Jan 2011 19:47:46 +0000 (-0500) Subject: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~5080 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=e45d989c5b8658ea43135ede6f5ca669b49a42e2;p=emacs.git * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Handle ?" and friends differently (e.g. don't use backrefs). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 373b427b7d5..919becd892d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-01-24 Stefan Monnier + + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): (bug#7735) + Handle ?" and friends differently (e.g. don't use backrefs). + 2011-01-24 Jay Belanger * calc/calc.el (calc-default-power-reference-level) @@ -6,8 +11,8 @@ (math-logunits): New variable. (math-extract-logunits, math-logcombine, calcFunc-luplus) (calcFunc-luminus, calc-luplus, calc-luminus, math-logunit-level) - (calcFunc-fieldlevel, calcFunc-powerlevel, calc-level): New - functions. + (calcFunc-fieldlevel, calcFunc-powerlevel, calc-level): + New functions. (math-find-base-units-rec): Add entry for ln(10). * calc/calc-help.el (calc-u-prefix-help): Add logarithmic help. (calc-ul-prefix-help): New function. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 2f10a7f2a97..733af999cdb 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1121,14 +1121,13 @@ See `add-log-current-defun-function'." (syntax-propertize-rules ;; #{ }, #$hoge, #@foo are not comments ("\\(#\\)[{$@]" (1 ".")) - ;; the last $', $", $` in the respective string is not variable - ;; the last ?', ?", ?` in the respective string is not ascii code - ("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*?\\\\?[?$]\\(\\2\\)" - (2 "\"") - (4 "\"")) ;; $' $" $` .... are variables ;; ?' ?" ?` are ascii codes - ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" (3 ".")) + ("\\([?$]\\)[#\"'`]" + (1 (unless (save-excursion + ;; Not within a string. + (nth 3 (syntax-ppss (match-beginning 0)))) + (string-to-syntax "\\")))) ;; regexps ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)" (4 "\"/")